<?php
class TTF_Form_Login extends Zend_Form
{
	public function init()
	{
		$this->setAction('/admin/login')
			->setMethod('post')
			->setName('loginform');
		
		// create text input for name
		$username = new Zend_Form_Element_Text('username');
		$username->setLabel('Tên đăng nhập:')
				->setOptions(array('size' => '28'))
				->setRequired(true)
				->addValidator('Alnum')
				->addFilter('HtmlEntities')
				->addFilter('StringTrim');
				
		// create text input for password
		$password = new Zend_Form_Element_Password('password');
		$password->setLabel('Mật khẩu:')
				->setOptions(array('size' => '28'))
				->setRequired(true)
				->addFilter('HtmlEntities')
				->addFilter('StringTrim');
				
		// create submit button
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setLabel('Đăng nhập')
			->setOptions(array('class' => 'loginbutton'));
			
		// attach elements to form
		$this->addElement($username)
			->addElement($password)
			->addElement($submit);
	}
}